import React from 'react';
import { Modal, Button, Radio } from 'antd';
// import * as routerActions from 'react-router-redux';
import './SortModal.scss';

const RadioGroup = Radio.Group;

class SubmitReport extends React.PureComponent {
  constructor(props) {
    super(props);
    this.state = {
      visible: false,
      value: 1,
    };
    this.onChange = ::this.onChange;
  }

  showModal() {
    this.setState({
      visible: true
    });
  }

  onCancel() {
    this.setState({
      visible: false,
    });
  }

  onSure(value) {
    const { onOk } = this.props;
    this.setState({
      visible: false,
    }, onOk && onOk(value));
  }

  onChange(e) {
    this.setState({ value: e.target.value });
  }

  render() {
    return (
      <Modal
        title="测试种类选择"
        visible={this.state.visible}
        width={760}
        heigth={718}
        onCancel={this.onCancel.bind(this)}
        className="submit-modal-page"
        footer={null}
      >
        <div className="sort" >
          <RadioGroup onChange={this.onChange} value={this.state.value} >
            <Radio value={1} >
              <div className="sort-items" >
                <img src="images/interactive/icon_make_up.png" alt="" />
                <div className="sort-content" >化妆品安全</div >
              </div >
            </Radio >
            <Radio value={2} >
              <div className="sort-items" >
                <img src="images/interactive/icon_food.png" alt="" />
                <div className="sort-content" >食品安全</div >
              </div >
            </Radio >
            <Radio value={3} >
              <div className="sort-items" >
                <img src="images/interactive/icon_serve.png" alt="" />
                <div className="sort-content" >餐饮业</div >
              </div >
            </Radio >
          </RadioGroup >
        </div >
        <div className="modal-footer" >
          <Button className="modal-okbtn" onClick={this.onSure.bind(this, this.state.value)} >
            确定
          </Button >
        </div >
      </Modal >
    );
  }
}

export default SubmitReport;
